<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>下拉菜单</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }

        .nav{
            width: 600px;
            height: 50px;
            background: skyblue;
            margin: 20px auto;
        }
        ul{
            list-style: none;
        }
        ul li{
            float: left;
            width: 120px;
            line-height: 50px;
            text-align: center;
        }
        ul li a{
            display: inline-block;
            width: 100px;
            text-decoration: none;
            color: white;
            font-family: "微软雅黑 Light";
            font-size: 20px;
        }
        ul li a:hover{
            background: skyblue;
        }
        ul li ul{
            width: 120px;
            display: none;
            background: white;
            box-shadow: 0 2px 3px black;
        }
        ul li ul li{
            float: none;
            width: 120px;
            text-align: center;
        }
        ul li ul:last-child{
            padding-bottom: 5px;
        }
        ul li ul li a{
            display: inline-block;
            text-decoration: none;
            font-size: 14px;
            color: black;
            width: 90px;
        }
        ul li ul a:hover{
            color: white;
            background-color: #944504;
        }
    </style>
</head>
<body>
<div class="nav">
    <ul>
        <li><a href="#">站点首页</a></li>
        <li onmouseover="showSub(this)" onmouseout="hideSub(this)">
            <a href="#">学校概况 </a>
            <ul>

                <li><a href="#"> 学校简介</a></li>
                <li><a href="#"> 历史沿革</a></li>
                <li><a href="#"> 校园风光</a></li>

            </ul>
        </li>
        <li><a href="#">组织机构</a></li>
        <li><a href="#">共享交流</a></li>
        <li><a href="#">联系我们</a></li>
    </ul>
</div>
</body>
</html>
<script>
    function showSub(li) {
        var  submenu=li.getElementsByTagName('ul')[0];
        submenu.style.display="block";
    }
    function hideSub(li) {
        var submenu=li.getElementsByTagName('ul')[0];
        submenu.style.display="none";
    }
</script>